var MJ = require('../MJ/MJ');



var SpecGang = {
     'HZFCG': 0,
     'LZG':1
//     'HZ':1,
//     'FC':2,
//     'LZ':3,
//     'BB':4
}
exports.OptionRule = {
    'HZFCLZG':1,
    'HZLZG':2
}
// var SpecGangScore = {};
// SpecGangScore[SpecGang.SF] = 4;
// SpecGangScore[SpecGang.XI] = 2;
// SpecGangScore[SpecGang.YD] = 2;
// SpecGangScore[SpecGang.JD] = 2;
// SpecGangScore[SpecGang.DD] = 4;

var ScoreRule = clone(MJ.ScoreRule);
ScoreRule.JiaHu = 201;          // 夹胡
ScoreRule.MenQing = 202;        // 门清
ScoreRule.SiGuiYi = 203;        // 四归一
ScoreRule.ShouBaYi =  204;      // 手把一
ScoreRule.YiBanGao =  205;      // 一般高
ScoreRule.HunYiSe =  206;       // 混一色
ScoreRule.QingYiSe =  207;      // 清一色
ScoreRule.SanJiaQing =  208;    // 三家清
ScoreRule.SiJiaQing =  209;     // 四家清
var RaiseFSInfo = {
    'YH':1,//'硬胡':0,
    'HZFCG':1,//'红中杠、发财杠':1,
    'LZG':2,//'赖子杠':2,
    'CLZ':2,//'吃赖子':3,
    'YJH':2,//'一句话':4,
    'TJH':1,//'三句话':5,
    'SJH':2,//'四句话':6,
    'MG':1,//'明杠':7,
    'AG':2,//'暗杠':8,
    'LLZ':1,//亮牌中有赖子
    'ZFLYC':3,//红中发财'亮一次':9,
    'ZFLYCLZ':4,//红中发财亮有赖子
   // 'ZFSL':6,//红中发财'双亮':10,
    //'ZFSLLZ':10,//红中发财双亮赖子
    'ZLYC':2,//红中亮一次
    //'ZSL':4,//红中双亮
    'ZLYCLZ':3,//'红中亮有赖子':11
    //'ZLLCLZ':8//'红中双亮赖子':11
}

var Pattern = {
    'NONE': 0,                // 不是可胡的牌型
    'NORMAL': MJ.Pattern.NORMAL,              // 平胡
    'PAIR': MJ.Pattern.PAIR,                   // 对对胡 碰碰胡
    'PAIR7': MJ.Pattern.PAIR7,                // 七对
    'JJH': 4,               // 将将胡
    'QIS':5,                //清一色
    'QISPAIR':6,            //清一色碰碰胡
    'QISJJH':7,              //清一色将将胡
    'QISPAIR7':8,            //清一色七对
    'HHPAIR7':9,             //豪华七对
    'YZM':10,                //硬自摸 
    'JPPH':11,              //将碰碰胡
    'QYSHHPAIR7':12         //清一色豪华七对
};

var PatternScore = {}
PatternScore[Pattern.NORMAL] = 0;
PatternScore[Pattern.PAIR] = 1;
PatternScore[Pattern.PAIR7] = 1;
PatternScore[Pattern.QISJJH] = 3;
PatternScore[Pattern.QISPAIR7] = 3;
PatternScore[Pattern.HHPAIR7] = 3;
PatternScore[Pattern.YZM] = 7;

var ItemScore = {};
ItemScore[ScoreRule.DH] = 1;
ItemScore[ScoreRule.ZM] = 1;
ItemScore[ScoreRule.LZ] = 1;
ItemScore[ScoreRule.GSH] = 1;
ItemScore[ScoreRule.GSP] = 1;
ItemScore[ScoreRule.QG] = 0;
ItemScore[ScoreRule.BT] = 1;
ItemScore[ScoreRule.TH] = 0;
ItemScore[ScoreRule.DIHU] = 0;
ItemScore[ScoreRule.TT] = 0;


ItemScore[ScoreRule.JiaHu] = 1;
ItemScore[ScoreRule.MenQing] = 1;
ItemScore[ScoreRule.SiGuiYi] = 1;
ItemScore[ScoreRule.ShouBaYi] = 1;
ItemScore[ScoreRule.YiBanGao] = 1;
ItemScore[ScoreRule.HunYiSe] = 1;
ItemScore[ScoreRule.QingYiSe] = 3;
ItemScore[ScoreRule.SanJiaQing] = 2;
ItemScore[ScoreRule.SiJiaQing] = 3;

var ScoreReason = {
    DH: MJ.Result.DH,  // 点胡/点炮
    ZM: MJ.Result.ZM,  // 自摸/被自摸
   // PIAO: 301,          // 飘

    BT: ScoreRule.BT, // 报听
    LZ: ScoreRule.LZ, // 庄家
    QG: ScoreRule.QG, // 抢杠
};

var GangScore = {};
GangScore[MJ.Gang.BA] = 2;
GangScore[MJ.Gang.AN] = 4;
GangScore[MJ.Gang.DIAN] = 2;
GangScore[MJ.Gang.ANS] = 4;
//特殊杠(红中发财赖子)
var SpeGang ={
    'HZFCLZG':5
};


exports.ScoreRule = ScoreRule;
exports.Pattern = Pattern;
exports.PatternScore = PatternScore;
exports.ItemScore = ItemScore;
exports.ScoreReason = ScoreReason;
exports.GangScore = GangScore;

exports.SpecGang = SpecGang;
//exports.SpecGangScore = SpecGangScore;

exports.RaiseFSInfo = RaiseFSInfo;